package top.swimmer.tokenizer;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

public class DateDemo {
    public static void main(String[] args) {
        epoch(LocalDateTime.of(2017, 12, 8, 15, 30, 0));
        epoch(LocalDateTime.of(2017, 12, 8, 16, 0, 0));
        epoch(LocalDateTime.of(2017, 12, 8, 0, 1, 0));
        System.out.println(LocalDateTime.ofInstant(Instant.ofEpochMilli(1512633600000L), ZoneId.systemDefault()));
    }

    private static void epoch(LocalDateTime time) {
        System.out.println(time.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
    }
}